52f1727401c4566b72abd4e4327dbd7c9bc3888a,source/com/intellij/xml/util/XmlUtil.java,XmlUtil,generateDocumentDTD,#XmlDocument#,825

Before Change


    final StringBuffer buffer = new StringBuffer();
    final Map<String,List<String>> tags = new HashMap<String, List<String>>();
    final Map<String,List<MyAttributeInfo>> attributes = new HashMap<String, List<MyAttributeInfo>>();
    computeTag(doc.getRootTag(), tags, attributes);
    final Iterator<String> iter = tags.keySet().iterator();
    while (iter.hasNext()) {
      final String tagName = iter.next();

After Change


    final StringBuffer buffer = new StringBuffer();
    final Map<String,List<String>> tags = new HashMap<String, List<String>>();
    final Map<String,List<MyAttributeInfo>> attributes = new HashMap<String, List<MyAttributeInfo>>();
    final XmlTag rootTag = doc.getRootTag();
    computeTag(rootTag, tags, attributes);
    
    // For supporting not welformed XML
    for(PsiElement element = rootTag != null ? rootTag.getNextSibling():null; 
        element != null; 
        element = element.getNextSibling()
    ) {